package com.github.data_manage.domain.vo

import com.fasterxml.jackson.annotation.JsonIgnore
import java.math.BigDecimal

/**
 * @author chenhainan
 * @since 2024-08-14 14:43
 */
class AnalysisVo {

    lateinit var name: String

    var type: Int = 1

    // 当月NAV
    var currentMonthNav: BigDecimal? = null

    // 当月回报
    var currentMonthRequite: BigDecimal? = null

    var currentYear: Int? = null

    // 年初至今回报
    var currentYearNav: BigDecimal? = null

    var lastYear: Int? = null

    // 去年回报
    var lastYearNav: BigDecimal? = null

    var beforeLastYear: Int? = null

    // 前年
    var beforeLastYearNav: BigDecimal? = null

    // 年化回报
    lateinit var yearNav: BigDecimal

    // 年化标准差
    lateinit var yearStandardDeviation: BigDecimal

    // 单月最大回报
    lateinit var maxMonthNav: BigDecimal

    // 单月最小回报
    lateinit var minMonthNav: BigDecimal

    // 正回报占比
    lateinit var positiveNavPercent: BigDecimal

    // 夏普比率
    lateinit var sharpRatio: BigDecimal

    // 相关性
    var correlation: BigDecimal? = null

    // 最大回撤
    lateinit var maxReturn: BigDecimal

    @JsonIgnore
    lateinit var allReturnData: List<BigDecimal>

    companion object{

        fun empty(): AnalysisVo{
            val analysisVo = AnalysisVo()
            analysisVo.currentMonthNav = BigDecimal.ZERO
            analysisVo.currentMonthRequite = BigDecimal.ZERO
            analysisVo.currentYearNav = BigDecimal.ZERO
            analysisVo.lastYearNav = BigDecimal.ZERO
            analysisVo.beforeLastYearNav = BigDecimal.ZERO
            analysisVo.yearNav = BigDecimal.ZERO
            analysisVo.yearStandardDeviation = BigDecimal.ZERO
            analysisVo.maxMonthNav = BigDecimal.ZERO
            analysisVo.minMonthNav = BigDecimal.ZERO
            analysisVo.positiveNavPercent = BigDecimal.ZERO
            analysisVo.sharpRatio = BigDecimal.ZERO
            analysisVo.correlation = null
            analysisVo.maxReturn = BigDecimal.ZERO

            return analysisVo
        }

    }
}
